package com.yinhai.mybatis_plus.mp.controller;


import com.yinhai.mybatis_plus.mp.entity.User;
import com.yinhai.mybatis_plus.mp.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李辉
 * @since 2019-07-17
 */
@RestController
@RequestMapping("/mp/user")
public class UserController {

    @Autowired
    private IUserService iUserService;

    @RequestMapping("/getUser")
    @ResponseBody
    public String getUser(){
        List<User> userList = iUserService.findAll();
        return userList.toString();
    }
}
